import { createRouter, createWebHistory, RouteRecordRaw,createWebHashHistory } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path:'/',
    redirect:'/login'
  },{
    path: '/login',
    name: 'Login',
    component: () => import('../pages/Login.vue')
  },{
    path:'/home',
    name:'Home',
    redirect:'/panel',
    component: () => import('../pages/Home.vue'),
    children:[
      {
        path:'/panel',
        component:() => import('../pages/panel/Panel.vue'),
        meta:{title:'系统首页'}
      },
      // {
      //   path:'/setting',
      //   component:() => import('../pages/setting/Setting.vue'),
      //   meta:{title:'轮播设置'}
      // },
      {
        path:'/add',
        component:() => import('../pages/music/musicAdd.vue'),
        meta:{title:'角色申请'}
      },
      {
        path:'/manage',
        component:() => import('../pages/music/musicManage.vue'),
        meta:{title:'用户管理'}
      },
      {
        path:'/user',
        component:() => import('../pages/user/User.vue'),
        meta:{title:'用户列表'}
      },
      {
        path:'/school',
        component:() => import('../pages/school/School.vue'),
        meta:{title:''}
      },
      {
        path:'/trends',
        component:() => import('../pages/trends/Trends.vue'),
        meta:{title:'题目管理'}
      },
      // 文件记得大写
      {
        path:'/knowledge',
        component:() => import('../pages/knowledge/Knowledge.vue'),
        meta:{title:'趣味小知识'}
      },
      {
        path:'/order',
        component:() => import('../pages/order/Order.vue'),
        meta:{title:'答题记录'}
      },
      {
        path:'/wallet',
        component:() => import('../pages/wallet/Wallet.vue'),
        meta:{title:'答题排名'}
      },
      {
        path:'/manager',
        component:() => import('../pages/manager/Manager.vue'),
        meta:{title:'管理员列表'}
      },
      {
        path:'/feedback',
        component:() => import('../pages/feedback/Feedback.vue'),
        meta:{title:'反馈列表'}
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
